---
// 笔记
import { getCollection } from 'astro:content';
import LayoutBase from '@/layouts/layout-base.astro';
import '@/styles/markdown-content.scss';

// 1. 为每个集合条目生成一个新路径
export async function getStaticPaths() {
  const practiceEntries = await getCollection('practice');
  return practiceEntries.map(entry => {
    return {
      params: { slug: entry.slug },
      props: { entry },
    }
  });
}
// 2. 当渲染的时候，你可以直接从属性中得到条目
const { entry } = Astro.props;
const { Content } = await entry.render();

const pageTitle = entry.data.title || entry.slug; // 浏览器页签标题
---

<LayoutBase title={pageTitle} description={entry.slug}>
  <!-- 文档内容 -->
  <section>
    <div class="hsm-markdown-content p-8 mx-auto max-w-[1200px]">
      <Content />
    </div>
  </section>
</LayoutBase>

<style>
</style>
